package com.example.hbase;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Administrator
 */
@SpringBootApplication
@EnableAsync
@EnableScheduling
@RestController
public class HBaseApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(HBaseApplication.class, args);
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addRedirectViewController("/", "/server/health");
    }

    @RequestMapping("/server/health")
    public String health() {
        return "I am ok!!!";
    }
}